#include <iostream>
#include<vector>
using namespace std;
using ll = long long;
ll a, b;
vector<ll> ans;
ll js(ll x)
{
    string s=to_string(x);
    ll res=1;
    for(int i=0;i<s.size();i++)
        res*=(s[i]-'0');
    return res;
}

void solve()
{
    ll maxx = -1;
    cin >> a >> b;
    for (ll i = a; i <= b;i++)
    {
        ll num = i;
        ll cnt = 0;
        while(num>9)
        {
            cnt++;
            num=js(num);
        }
        if(maxx<=cnt)
        {
            if(cnt>maxx)
            {
                maxx = cnt;
                ans.clear();
            }
            ans.push_back(i);
        }
    }
    cout<<maxx<<endl;
    for (ll i = 0; i < ans.size();i++)
    {
        if(i!=ans.size()-1)
        {
            cout << ans[i] << " ";
        }
        else 
        cout << ans[i];
    }
}
int main()
{
    ll n = 1;
    //cin >> n;
    while (n--)
    {
        solve();
    }
}